home *** CD-ROM | disk | FTP | other *** search
- Path: news.dfn.de!si-nic!usenet
- From: Markus Becker <becker@zess.uni-siegen.de>
- Newsgroups: comp.lang.c
- Subject: Apology, was: Re: Limit on #bytes inside of struct?
- Date: Mon, 12 Feb 1996 15:31:41 +0100
- Organization: ZESS, Uni-GH-Siegen
- Message-ID: <311F4F4D.7784@zess.uni-siegen.de>
- References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffg6b$ivd@sparcserver.lrz-muenchen.de> <4ffohq$1gb@mordred.gatech.edu> <4ffun7$1l4l@cymbal.aix.calpoly.edu> <311F15D8.78D1@zess.uni-siegen.de> <9602121217.AA07160@dxmint.cern.ch>
- NNTP-Posting-Host: becker.zess.uni-siegen.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Ok, this one, to get my face back :)
-
- Dan Pop wrote:
- > I wrote:
- >
- > >No it isn't, see below.
- > >
- > >> typedef struct {
- > >> int the_array[50000];
- > >> } struct_type;
- > >>
- > >
- > >This way, you don't put the 50K numbers in the struct, but only
- > >a pointer to them. Should be at most 4 bytes.
- >
- > Why do clueless people insist on posting their answers and corrections,
- > making fools of themselves in front of the whole world is beyond me.
-
- Because making mistakes is human (or something like that).
-
- >
- > Please take these two mandatory steps before posting your answers and
- > objections to other people's answers to c.l.c: ^^^^^^^^^^
-
- There weren't any objections meant in my post. Or is my understanding
- of "objection" as wrong as I was on the subject?
-
- >
- > 1. Learn C. A _good_ book will help a lot.
-
- I think I know C. And also know of good books. No problem.
-
- > For the technical part of the article:
- >
- > o I'm typing this on a system where pointers are 8 bytes and I do know
- > a system which has 16-byte pointers (and is in current use today).
-
- Ok, at most/at least *is* a difference (besides the fact that I was
- wrong).
-
- > o Try printing the value of sizeof(struct_type). The most likely
- > results are 100000 and 200000 (that is, if you use the correct
-
- Did it. 200000. But that was clear as soon as I thought about alloc'ing such
- a structure.
-
- > o As steps #1 and #2 mentioned above will show you, an array decays into
- > a pointer only when used in a value context. And, of course, pointers
- > and arrays are _not_ equivalent and cannot be used interchangeably.
-
- I had a sentence somewhere in the back of my mind "that arrays and pointers
- in C are equivalent and completely interchangeable". Could it be K&R?
-
- > >http://www.zess.uni-siegen.de/private/becker/win95
- > ^^^^^
- > Could this explain the confusion of the poster? :-)
-
- Maybe:) If you deal with the kind of problems you come across when
- implementing Software using such a "system", some things can get lost.
-
- I've shot too fast. Next time I will think twice.
- --
- Markus Becker
-